package com.ruoyi.web.controller.app.controller;

import com.ruoyi.framework.web.exception.base.XResult;
import com.ruoyi.web.controller.app.service.AppCollectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import java.util.Map;

/**
 * @ClassName MyCollectController
 * @Description 收藏管理
 * @Author tyc@yanyu
 * @Date 2018/12/7 0007 15:56
 **/
@RestController
@RequestMapping("/app/mycollect")
@Api(tags = "收藏管理")    //IM已做
public class AppCollectController {

    @Autowired
    private AppCollectService myCollectService;

    /**
     * 收藏
     * @return
     */
    @RequestMapping(value = "addCollect",method = RequestMethod.POST)
    @ApiOperation(value = "收藏",position = 1,notes = "收藏信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "memberId", value = "用户ID号", required = true, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "content", value = "内容", required = true, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "remark", value = "备注", required = false, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "createDate", value = "收藏时间", required = true, dataType = "String", paramType = "query"),
    })
    public XResult addCollect(@RequestParam @ApiIgnore Map<String,String> map){

        return new XResult("操作成功",myCollectService.addCollect(map));
    }
}
